package chooongg.base.utils

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

suspend fun withMain(block: () -> Unit) = withContext(Dispatchers.Main) {
    block.invoke()
}

suspend fun withIO(block: () -> Unit) = withContext(Dispatchers.IO) {
    block.invoke()
}

suspend fun withDefault(block:()->Unit) = withContext(Dispatchers.Default){
    block.invoke()
}

suspend fun withUnconfined(block:()->Unit) = withContext(Dispatchers.Unconfined){
    block.invoke()
}